/*
 * Copyright (C) 2019 ~ 2022 Uniontech Technology Co., Ltd.
 *
 * Author:     zhangbingyi <zhangbingyi@uniontech.com>
 *
 * Maintainer: zhangbingyi <zhangbingyi@uniontech.com>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#ifndef PERIPHERALSMANAGEMENTWIDGET_H
#define PERIPHERALSMANAGEMENTWIDGET_H

#include "widgets/safetyprotectionitem.h"
#include "gsettingkey.h"

#include <QFrame>

class PeripheralsManagementModel;
class PeripheralsManagementWidget : public QFrame
{
    Q_OBJECT
public:
    explicit PeripheralsManagementWidget(PeripheralsManagementModel *model, QFrame *parent = nullptr);

private:
    // 初始化界面
    void initUI();

public Q_SLOTS:
    // USB管控切换槽
    void acceptUSBSwitchItemChange(bool status);
    // 摄像头管控切换槽
    void acceptCameraSwitchItemChange(bool status);
    // 打印机管控切换槽
    void acceptprinterSwitchItemChange(bool status);

    void notifyPeripheralsRevert();
    void synPeripheralsStatus(const QString &key, bool open);
private:
    PeripheralsManagementModel *m_model;
    SafetyProtectionItem *m_USBSwitchItem;
    SafetyProtectionItem *m_cameraSwitchItem;
    SafetyProtectionItem *m_printerSwitchItem;
};

#endif // PERIPHERALSMANAGEMENTWIDGET_H
